<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>for练习2</title>
	<script type="text/javascript">

		/*
		 * 打印1-100之间所有7的倍数的个数及总和
		 */
		//定义一个变量，来保存总和
		var sum = 0;
		//定义一个计数器，来记录数量
		var count = 0;

		//打印1-100之间所有的数
		for (var i = 1; i <= 100; i++) {

			//判断i是否是7的倍数
			if (i % 7 == 0) {
				//console.log(i);
				sum += i;
				//使计数器自增1
				count++;

			}

		}

		//输出总和
		console.log("总和为:" + sum);
		//输出总数
		console.log("总数量为:" + count);



	</script>
</head>

<body>
</body>

</html>